package com.jy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jy.pojo.Car;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface CarMapper extends BaseMapper<Car> {
    Page<Car> findPage(Page<Car> page, Car car);

    @Select("select c.*,t.name tname from car c left join type t on t.id = c.tid ")
    List<Car> findAll();

    @Select("select t.name x,count(*) y from car c,type t where c.tid = t.id group by t.id")
    List<Map> findCount();
}
